package com.cg.design.depthdesign.prototype.shapes;

/**
 * 简单形状(园)
 *
 * @author cg
 * @program LeetCode->Circle
 * @create 2022-06-04 16:12
 **/
public class Circle extends Shape {

    public int radius;

    public Circle() {

    }

    public Circle(Circle target) {
        super(target);
        if (target != null) {
            this.radius = target.radius;
        }
    }

    @Override
    public Shape clone() {
        return new Circle(this);
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Circle) || !super.equals(obj)) {
            return false;
        }
        Circle circle = (Circle) obj;
        return circle.radius == radius;
    }
}
